#define _CRT_SECURE_NO_WARNINGS 1
//BTNode* TreeFind(BTNode*root,int x)
//{
//	static BTNode* order;
//	if (root == NULL)
//	{
//		return NULL;
//	}
//	if (root->val == x)
//	{
//		order = root;
//		return root;
//	}
//	return TreeFind(root->left, x)||TreeFind(root->right,x)?order:NULL;
//}
BTNode* TreeFind(BTNode* root, int x)
{
	BTNode* order;
	if (root == NULL)
	{
		return NULL;
	}
	if (root->val == x)
	{
		order = root;
		return root;
	}
	TreeFind(root->left, x);
	if (order)
		return order;
	TreeFind(root->right, x)
	if (order)
		return order;
	return NULL;
}
bool IsSameTree(BTNode*n1,BTNode*n2)
{
	if (n1 == n2 && n1 == NULL)
	{
		return true;
	}
	if (n1->left != n2->left)
	{
		return false;
	}
	if (n1->right != n2->right)
	{
		return false;
	}
	
	return IsSameTree(n1->left, n2->left) && IsSameTree(n1->right, n1->right);
}